package com.example.agent2;

import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;

import java.util.List;

/**
 * @author csp 2023-08-22
 */
public class Test {

    public static void main(String[] args) {
        List<VirtualMachineDescriptor> list = VirtualMachine.list();
        for (VirtualMachineDescriptor vmd : list)
        {
            System.out.println("pid:" + vmd.id() + ":" + vmd.displayName());
        }

    }
}
